<!doctype html>
<html>
	<head>
		<meta charset='utf-8'>
		<title>素材处理</title>
	</head>
	<body>
		<input type='file' value='请选择图片' id='fileSelector'><br>
		<img id='viewer'><br>
		<div id='baseViewer' style='width:100%'></div>
		<script>
			window.onload=function(){
				let fileSelector=document.getElementById('fileSelector');
				let viewer=document.getElementById('viewer');
				let baseViewer=document.getElementById('baseViewer');
				fileSelector.onchange=function(event){
					let file=event.target.files[0];
					let reader=new FileReader();
					reader.onload = function(ev){
						let imgSrc=ev.target.result;
						baseViewer.innerText='请复制图片地址';
						viewer.src=imgSrc;
					}
					reader.readAsDataURL(file);
				}
			}
		</script>
	</body>
</html>